<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/qt3support/widgets/q3groupbox.cpp -->
<head>
  <title>Qt 4.3: Q3GroupBox Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Q3GroupBox Class Reference<br /><sup><sup>[<a href="qt3support.html">Qt3Support</a> module]</sup></sup></h1>
<p>The Q3GroupBox widget provides a group box frame with a title. <a href="#details">More...</a></p>
<pre> #include &lt;Q3GroupBox&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qgroupbox">Porting to Qt 4</a> for more information.</p>
<p>Inherits <a href="qgroupbox.html">QGroupBox</a>.</p>
<p>Inherited by <a href="q3buttongroup.html">Q3ButtonGroup</a>, <a href="q3hgroupbox.html">Q3HGroupBox</a>, and <a href="q3vgroupbox.html">Q3VGroupBox</a>.</p>
<ul>
<li><a href="q3groupbox-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h3>Properties</h3>
<p><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"/><b><a href="q3groupbox.html#columns-prop">columns</a></b> : int</li>
<li><div class="fn"/><b><a href="q3groupbox.html#frameRect-prop">frameRect</a></b> : const QRect</li>
<li><div class="fn"/><b><a href="q3groupbox.html#frameShadow-prop">frameShadow</a></b> : FrameShape</li>
<li><div class="fn"/><b><a href="q3groupbox.html#frameShape-prop">frameShape</a></b> : FrameShape</li>
</ul></td><td valign="top"><ul>
<li><div class="fn"/><b><a href="q3groupbox.html#lineWidth-prop">lineWidth</a></b> : int</li>
<li><div class="fn"/><b><a href="q3groupbox.html#margin-prop">margin</a></b> : int</li>
<li><div class="fn"/><b><a href="q3groupbox.html#midLineWidth-prop">midLineWidth</a></b> : int</li>
<li><div class="fn"/><b><a href="q3groupbox.html#orientation-prop">orientation</a></b> : Qt::Orientation</li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div class="fn"/>5 properties inherited from <a href="qgroupbox.html#properties">QGroupBox</a></li>
<li><div class="fn"/>56 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="q3groupbox.html#Q3GroupBox">Q3GroupBox</a></b> ( QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
<li><div class="fn"/><b><a href="q3groupbox.html#Q3GroupBox-2">Q3GroupBox</a></b> ( const QString &amp; <i>title</i>, QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
<li><div class="fn"/><b><a href="q3groupbox.html#Q3GroupBox-3">Q3GroupBox</a></b> ( int <i>strips</i>, Qt::Orientation <i>orientation</i>, QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
<li><div class="fn"/><b><a href="q3groupbox.html#Q3GroupBox-4">Q3GroupBox</a></b> ( int <i>strips</i>, Qt::Orientation <i>orientation</i>, const QString &amp; <i>title</i>, QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
<li><div class="fn"/><b><a href="q3groupbox.html#dtor.Q3GroupBox">~Q3GroupBox</a></b> ()</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#addSpace">addSpace</a></b> ( int <i>size</i> )</li>
<li><div class="fn"/>int <b><a href="q3groupbox.html#columns-prop">columns</a></b> () const</li>
<li><div class="fn"/>FrameShape <b><a href="q3groupbox.html#frameShadow-prop">frameShadow</a></b> () const</li>
<li><div class="fn"/>FrameShape <b><a href="q3groupbox.html#frameShape-prop">frameShape</a></b> () const</li>
<li><div class="fn"/>int <b><a href="q3groupbox.html#frameStyle">frameStyle</a></b> () const</li>
<li><div class="fn"/>int <b><a href="q3groupbox.html#insideMargin">insideMargin</a></b> () const</li>
<li><div class="fn"/>int <b><a href="q3groupbox.html#insideSpacing">insideSpacing</a></b> () const</li>
<li><div class="fn"/>int <b><a href="q3groupbox.html#lineWidth-prop">lineWidth</a></b> () const</li>
<li><div class="fn"/>int <b><a href="q3groupbox.html#margin-prop">margin</a></b> () const</li>
<li><div class="fn"/>int <b><a href="q3groupbox.html#midLineWidth-prop">midLineWidth</a></b> () const</li>
<li><div class="fn"/>Qt::Orientation <b><a href="q3groupbox.html#orientation-prop">orientation</a></b> () const</li>
<li><div class="fn"/>virtual void <b><a href="q3groupbox.html#setColumnLayout">setColumnLayout</a></b> ( int <i>strips</i>, Qt::Orientation <i>direction</i> )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#columns-prop">setColumns</a></b> ( int )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#frameShadow-prop">setFrameShadow</a></b> ( FrameShape )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#frameShape-prop">setFrameShape</a></b> ( FrameShape )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#setFrameStyle">setFrameStyle</a></b> ( int <i>style</i> )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#setInsideMargin">setInsideMargin</a></b> ( int <i>m</i> )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#setInsideSpacing">setInsideSpacing</a></b> ( int <i>s</i> )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#lineWidth-prop">setLineWidth</a></b> ( int )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#margin-prop">setMargin</a></b> ( int <i>margin</i> )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#midLineWidth-prop">setMidLineWidth</a></b> ( int )</li>
<li><div class="fn"/>void <b><a href="q3groupbox.html#orientation-prop">setOrientation</a></b> ( Qt::Orientation )</li>
</ul>
<ul>
<li><div class="fn"/>9 public functions inherited from <a href="qgroupbox.html#public-functions">QGroupBox</a></li>
<li><div class="fn"/>201 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div class="fn"/>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>1 public slot inherited from <a href="qgroupbox.html#public-slots">QGroupBox</a></li>
<li><div class="fn"/>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"/>2 signals inherited from <a href="qgroupbox.html#signals">QGroupBox</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"/>1 protected function inherited from <a href="qgroupbox.html#protected-functions">QGroupBox</a></li>
<li><div class="fn"/>38 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"/>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"/>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The Q3GroupBox widget provides a group box frame with a title.</p>
<p>A group box provides a frame, a title and a keyboard shortcut, and displays various other widgets inside itself. The title is on top, the keyboard shortcut moves keyboard focus to one of the group box's child widgets, and the child widgets are usually laid out horizontally (or vertically) inside the frame.</p>
<p>The simplest way to use it is to create a group box with the desired number of columns (or rows) and orientation, and then just create widgets with the group box as parent.</p>
<p>It is also possible to change the <a href="q3groupbox.html#orientation-prop">orientation</a>() and number of <a href="q3groupbox.html#columns-prop">columns</a>() after construction, or to ignore all the automatic layout support and manage the layout yourself. You can add 'empty' spaces to the group box with <a href="q3groupbox.html#addSpace">addSpace</a>().</p>
<p>Q3GroupBox also lets you set the <a href="qgroupbox.html#title-prop">title</a>() (normally set in the constructor) and the title's <a href="qgroupbox.html#alignment-prop">alignment</a>().</p>
<p>You can change the spacing used by the group box with <a href="q3groupbox.html#setInsideMargin">setInsideMargin</a>() and <a href="q3groupbox.html#setInsideSpacing">setInsideSpacing</a>(). To minimize space consumption, you can remove the right, left and bottom edges of the frame with <a href="qgroupbox.html#flat-prop">setFlat</a>().</p>
<p>See also <a href="qbuttongroup.html">QButtonGroup</a>.</p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="columns-prop"></a>columns : int</h3>
<p>This property holds the number of columns or rows (depending on Q3GroupBox::orientation) in the group box.</p>
<p>Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is best to set the number of columns directly in the constructor.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>int columns () const</b></li>
<li><div class="fn"/><b>void setColumns ( int )</b></li>
</ul>
<h3 class="fn"><a name="frameRect-prop"></a>frameRect : const <a href="qrect.html">QRect</a></h3>
<p>This property holds the bounding rectangle of the frame of the group box.</p>
<h3 class="fn"><a name="frameShadow-prop"></a>frameShadow : FrameShape</h3>
<p>This property holds the frame shadow value from the frame style.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>FrameShape frameShadow () const</b></li>
<li><div class="fn"/><b>void setFrameShadow ( FrameShape )</b></li>
</ul>
<p>See also <a href="q3groupbox.html#frameStyle">frameStyle</a>().</p>
<h3 class="fn"><a name="frameShape-prop"></a>frameShape : FrameShape</h3>
<p>This property holds the frame shape value from the frame style.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>FrameShape frameShape () const</b></li>
<li><div class="fn"/><b>void setFrameShape ( FrameShape )</b></li>
</ul>
<p>See also <a href="q3groupbox.html#frameStyle">frameStyle</a>() and <a href="q3groupbox.html#frameShadow-prop">frameShadow</a>().</p>
<h3 class="fn"><a name="lineWidth-prop"></a>lineWidth : int</h3>
<p>This property holds this property holds the width of the line.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>int lineWidth () const</b></li>
<li><div class="fn"/><b>void setLineWidth ( int )</b></li>
</ul>
<p>See also <a href="q3groupbox.html#frameStyle">frameStyle</a>() and <a href="q3groupbox.html#frameShadow-prop">frameShadow</a>().</p>
<h3 class="fn"><a name="margin-prop"></a>margin : int</h3>
<p>This property holds the width of the margin around the contents of the group box.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>int margin () const</b></li>
<li><div class="fn"/><b>void setMargin ( int <i>margin</i> )</b></li>
</ul>
<h3 class="fn"><a name="midLineWidth-prop"></a>midLineWidth : int</h3>
<p>This property holds this property holds the width of the mid-line.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>int midLineWidth () const</b></li>
<li><div class="fn"/><b>void setMidLineWidth ( int )</b></li>
</ul>
<p>See also <a href="q3groupbox.html#frameStyle">frameStyle</a>() and <a href="q3groupbox.html#frameShadow-prop">frameShadow</a>().</p>
<h3 class="fn"><a name="orientation-prop"></a>orientation : <a href="qt.html#Orientation-enum">Qt::Orientation</a></h3>
<p>This property holds the group box's orientation.</p>
<p>A horizontal group box arranges its children in columns, while a vertical group box arranges them in rows.</p>
<p>Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is better to set the orientation directly in the constructor.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>Qt::Orientation orientation () const</b></li>
<li><div class="fn"/><b>void setOrientation ( Qt::Orientation )</b></li>
</ul>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="Q3GroupBox"></a>Q3GroupBox::Q3GroupBox ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Constructs a group box widget with no title.</p>
<p>The <i>parent</i> and <i>name</i> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.</p>
<p>This constructor does not do automatic layout.</p>
<h3 class="fn"><a name="Q3GroupBox-2"></a>Q3GroupBox::Q3GroupBox ( const <a href="qstring.html">QString</a> &amp; <i>title</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Constructs a group box with the title <i>title</i>.</p>
<p>The <i>parent</i> and <i>name</i> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.</p>
<p>This constructor does not do automatic layout.</p>
<h3 class="fn"><a name="Q3GroupBox-3"></a>Q3GroupBox::Q3GroupBox ( int <i>strips</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Constructs a group box with no title. Child widgets will be arranged in <i>strips</i> rows or columns (depending on <i>orientation</i>).</p>
<p>The <i>parent</i> and <i>name</i> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.</p>
<h3 class="fn"><a name="Q3GroupBox-4"></a>Q3GroupBox::Q3GroupBox ( int <i>strips</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, const <a href="qstring.html">QString</a> &amp; <i>title</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Constructs a group box titled <i>title</i>. Child widgets will be arranged in <i>strips</i> rows or columns (depending on <i>orientation</i>).</p>
<p>The <i>parent</i> and <i>name</i> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.</p>
<h3 class="fn"><a name="dtor.Q3GroupBox"></a>Q3GroupBox::~Q3GroupBox ()</h3>
<p>Destroys the group box.</p>
<h3 class="fn"><a name="addSpace"></a>void Q3GroupBox::addSpace ( int <i>size</i> )</h3>
<p>Adds an empty cell at the next free position. If <i>size</i> is greater than 0, the empty cell takes <i>size</i> to be its fixed width (if <a href="q3groupbox.html#orientation-prop">orientation</a>() is <tt>Horizontal</tt>) or height (if <a href="q3groupbox.html#orientation-prop">orientation</a>() is <tt>Vertical</tt>).</p>
<p>Use this method to separate the widgets in the group box or to skip the next free cell. For performance reasons, call this method after calling <a href="q3groupbox.html#setColumnLayout">setColumnLayout</a>() or by changing the <a href="q3groupbox.html#columns-prop">Q3GroupBox::columns</a> or <a href="q3groupbox.html#orientation-prop">Q3GroupBox::orientation</a> properties. It is generally a good idea to call these methods first (if needed at all), and insert the widgets and spaces afterwards.</p>
<h3 class="fn"><a name="frameStyle"></a>int Q3GroupBox::frameStyle () const</h3>
<p>Returns the frame style.</p>
<p>See also <a href="q3groupbox.html#setFrameStyle">setFrameStyle</a>().</p>
<h3 class="fn"><a name="insideMargin"></a>int Q3GroupBox::insideMargin () const</h3>
<p>Returns the width of the empty space between the items in the group and the frame of the group.</p>
<p>Only applies if the group box has a defined orientation.</p>
<p>The default is usually 11, by may vary depending on the platform and style.</p>
<p>See also <a href="q3groupbox.html#setInsideMargin">setInsideMargin</a>() and <a href="q3groupbox.html#orientation-prop">orientation</a>.</p>
<h3 class="fn"><a name="insideSpacing"></a>int Q3GroupBox::insideSpacing () const</h3>
<p>Returns the width of the empty space between each of the items in the group.</p>
<p>Only applies if the group box has a defined orientation.</p>
<p>The default is usually 5, by may vary depending on the platform and style.</p>
<p>See also <a href="q3groupbox.html#setInsideSpacing">setInsideSpacing</a>() and <a href="q3groupbox.html#orientation-prop">orientation</a>.</p>
<h3 class="fn"><a name="setColumnLayout"></a>void Q3GroupBox::setColumnLayout ( int <i>strips</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>direction</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Changes the layout of the group box. This function is only useful in combination with the default constructor that does not take any layout information. This function will put all existing children in the new layout. It is not good Qt programming style to call this function after children have been inserted. Sets the number of columns or rows to be <i>strips</i>, depending on <i>direction</i>.</p>
<p>See also <a href="q3groupbox.html#orientation-prop">orientation</a> and <a href="q3groupbox.html#columns-prop">columns</a>.</p>
<h3 class="fn"><a name="setFrameStyle"></a>void Q3GroupBox::setFrameStyle ( int <i>style</i> )</h3>
<p>Sets the frame style to <i>style</i>. The style is the bitwise OR between a frame shape and a frame shadow style.</p>
<p>See also <a href="q3groupbox.html#frameStyle">frameStyle</a>().</p>
<h3 class="fn"><a name="setInsideMargin"></a>void Q3GroupBox::setInsideMargin ( int <i>m</i> )</h3>
<p>Sets the the width of the inside margin to <i>m</i> pixels.</p>
<p>See also <a href="q3groupbox.html#insideMargin">insideMargin</a>().</p>
<h3 class="fn"><a name="setInsideSpacing"></a>void Q3GroupBox::setInsideSpacing ( int <i>s</i> )</h3>
<p>Sets the width of the empty space between each of the items in the group to <i>s</i> pixels.</p>
<p>See also <a href="q3groupbox.html#insideSpacing">insideSpacing</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
